/**
 * @(#) HealthCheckUpFacade.as
 *
 * @date		2009. 05. 07.
 * @version		1.0
 * @author		Park, Juneho
 * @description	module facade (건강검진)
 * 				mvc간 주고 받는 메세지를 정의하고,  command를 등록한다. 
 */
package com.skt.common_hr.healthcheckup
{
	import com.skt.common_hr.common.puremvc.CommonFacade;
	import com.skt.common_hr.healthcheckup.controller.StartupCommand;
	
	import flash.display.DisplayObject;
	
	public class HealthCheckUpFacade extends CommonFacade
	{
		public static const STARTUP:String 									= 'startup';
		public static const CLOSE_MODULE:String								= 'closeModule';
		
		public static const LOAD_Healthchkreq_LIST_COMPLETE:String			= 'LoadHealthchkreqListComplete';
		public static const LOAD_Healthchkreq_LIST_FAILED:String				= 'LoadHealthchkreqListFailed';
		public static const LOAD_END_DAY_COMPLETE:String					= 'LoadEndDayComplete';
		public static const LOAD_END_DAY_FAILED:String						= 'LoadEndDayFailed';
		public static const LOAD_HOSPITAL_LIST_COMPLETE:String				= 'LoadHospitalListComplete';
		public static const LOAD_HOSPITAL_LIST_FAILED:String				= 'LoadHospitalListFailed';
		public static const LOAD_CHOICE_COMBO_LIST_COMPLETE:String			= 'LoadChoiceComboListComplete';
		public static const LOAD_CHOICE_COMBO_LIST_FAILED:String			= 'LoadChoiceComboListFailed';
		public static const LOAD_HOSPITAL_DEFAULT_COMPLETE:String			= 'LoadHospitalDefaultComplete';
		public static const LOAD_HOSPITAL_DEFAULT_FAILED:String				= 'LoadHospitalDefaultFailed';
		public static const LOAD_SAVE_COMPLETE:String						= 'LoadSaveComplete';
		public static const LOAD_SAVE_FAILED:String							= 'LoadSaveFailed';
		
		
		public function HealthCheckUpFacade( key:String )
		{
			super(key);	
		}
		
        /**
         * Singleton ApplicationFacade Factory Method
         */
        public static function getInstance( key:String ) : HealthCheckUpFacade 
        {
            if ( instanceMap[ key ] == null ) instanceMap[ key ] = new HealthCheckUpFacade( key );
            return instanceMap[ key ] as HealthCheckUpFacade;
        }

        /**
         * Register Commands with the Controller 
         *     - parent 클래스의 생성자에서 자동으로 호출됨
         */
        override protected function initializeController( ) : void {
            super.initializeController();            
            registerCommand( STARTUP, StartupCommand);
        }
       
        /**
         * Module의 시작점으로 Healthchkreq.mxml의 creationComplete 이벤트에서 호출한다.
         *     
         */
        public function startup(app:Object) :void 
        {
        	this.app = app as DisplayObject;
            sendNotification( STARTUP, app );
        }
		
	}
}